package com.lagou.edu.notice.cnqueue;


import com.lagou.edu.notice.service.MsgService;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class Consumer {

    @Autowired
    private MsgService msgService;

    /**
     * 使用socketIOServer向客户端推送消息
     * @param message
     */
    @RabbitListener(queues = "queue.boot")
    public void service(String message) {
        System.out.println(">>>>Message received: " + message);
        msgService.push(message);
    }
}

